<template>
    <vxe-select v-model="currentValue" placeholder="请选择" size="mini">
        <vxe-option v-for="(item, index) in optinons" :key="index" :value="item.Id" :label="item.Name"></vxe-option>
    </vxe-select>
</template>

<script>
  // import {permissionApi} from '@/api/organizationApiNow.js'
  import permissionApi from '@/api/organizationApi/permissionApi.js'

    export default {
        name: "SelectDeparament",
        props: {
            // v-model绑定的数据
            value: {
                type: [String, Number],
                default: function () {
                    return null
                }
            }
        },
        computed: {
            // 转换绑定的选中数据，与v-model同步
            currentValue: {
                get: function () {
                    return this.value
                },
                set: function (value) {
                    this.$emit('input', value)
                }
            }
        },
        mounted() {
            this.getList()
        },
        data() {
            return {
                optinons: []
            }
        },
        methods: {
            getList() {
                permissionApi.getList().then(res => {
                    this.optinons = res
                })
            }
        }
    }
</script>

<style scoped>

</style>
